package org.mycub.server.dataprovider;

import java.util.List;

import org.mycub.server.data.models.TramStation;
import org.mycub.server.mongodb.MongoDB;

public class TramStationsProvider {

	/**
	 * @param args
	 */
	private List<TramStation> stations;

	public TramStationsProvider(){
	}

	public List<TramStation> getTrams(double longitude, double latitude, double rayon){

		List<TramStation> tramStations = MongoDB.dataStore.find(TramStation.class).
				field("location").within(longitude,latitude,rayon).asList();

		setStations(tramStations);
		return getStations();
	}

	public List<TramStation> getStations() {
		return stations;
	}

	public void setStations(List<TramStation> stations) {
		this.stations = stations;
	}

}
